package cloudspace.stats.achieve;

import org.zkoss.zul.AbstractListModel;

import cloudspace.stats.StatisticsService;


public class AchieveModel extends AbstractListModel
{
    /**
	 * 
	 */
    private static final long serialVersionUID = -7218157169384633809L;

    private String username;


    public AchieveModel( String userName )
    {
        username = userName;
    }


    public void setUsername( String userName )
    {
        username = userName;
    }


    public Object getElementAt( int arg0 )
    {
        String key = (String)StatisticsService.getStatService()
            .getKeys( username )
            .toArray()[arg0];
        return StatisticsService.getStatService().get( username, key );
    }


    public int getSize()
    {
        int size = StatisticsService.getStatService()
            .getKeys( username )
            .size();
        return size;
    }

}
